<?php
class App_Cache extends Zend_Cache {
	/**
	 * returns standard cache instance
	 *
	 * @return Zend_Cache
	 */
	static public function getInstance($cacheDir) {
		try {
			$cache = Zend::registry('cache');
		}
		catch (Zend_Exception $e) {
			try {
				$frontendOptions = array(
					'automaticSerialization' => true
				);
				$backendOptions = array(
					'cacheDir' => $cacheDir,
				);
				$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
			}
			catch (Exception $e) {
				throw new App_Exception('Can\'t get cache');
			}
		}
		return $cache;
	}
}



?>